// 1-4-1 重载运算符和重载函数-实例-输入/输出运算符重载
#include <iostream>

class Distance
{
private:
  int feet;
  int inchs;

public:
  Distance(int, int);
  ~Distance();

  friend std::istream &operator>>(std::istream &input, Distance &obj)
  {
    input >> obj.feet >> obj.inchs;
    return input;
  }

  friend std::ostream &operator<<(std::ostream &output, const Distance &obj)
  {
    output << "F : " << obj.feet << " i : " << obj.inchs;
    return output;
  }
};

Distance::Distance(int a, int b) : feet(a), inchs(b)
{
}

Distance::~Distance()
{
}

int main(void)
{
  Distance d1(1,2);
  std::cout << d1 << std::endl;
  std::cin >> d1;
  std::cout << d1 << std::endl;
  printf("-----------------end-----------------\n");
  return 0;
}